/*
 * NewJFrame.java
 *
 * Created on 20 de Agosto de 2009, 16:06
 */
package siii;
import Conector.Conector;
import Data.Pesqueiro;
import JPaneis.Grupo2;
import JPaneis.MenuCadastrarCliente;
import JPaneis.MenuCadastrarCompraPeixes;
import JPaneis.MenuCadastrarEditarServicoPesca;
import JPaneis.MenuCadastrarEditarServicoPiscina;
import JPaneis.MenuCadastrarFuncionario;
import JPaneis.MenuComprarPeixePiscina;
import JPaneis.MenuDadosPesqueiro1;
import JPaneis.MenuPrincipal;
import JPaneis.Relatorios;
import JPaneis.MenuServicoPesca;
import JPaneis.Relatorios;
import java.awt.BorderLayout;
import javax.swing.JPanel;

public class MenuPadrao extends javax.swing.JFrame {
    
    private Conector conector;
    private Pesqueiro pesqueiro;
    private MenuCadastrarCliente menuEditarCadastroCliente;
    private MenuCadastrarCliente menuCadastrarCliente;
    private MenuCadastrarEditarServicoPesca menuCadastrarServicoPesca;
    private MenuCadastrarEditarServicoPesca menuEditarServicoPesca;
    private MenuCadastrarEditarServicoPiscina menuEditarServicoPiscina;
    private MenuCadastrarEditarServicoPiscina menuCadastrarServicoPiscina;
    private MenuCadastrarFuncionario menuCadastrarFuncionario;
    private MenuCadastrarFuncionario menuEditarCadastroFuncionario;
    private MenuCadastrarFuncionario menuExcluirCadastroFuncionario;
    private MenuComprarPeixePiscina menuComprarPeixePiscina;
    private Grupo2 sobreGrupo = new Grupo2(this);
    private MenuDadosPesqueiro1 menuPesqueiro;
    private MenuPrincipal menuPrincipal;
    private Relatorios relatorios;
    private MenuServicoPesca menuServicoPesca;
    private MenuCadastrarCompraPeixes menuCadastrarCompraPeixes;
    private JPanel atual = new JPanel();
    /** Creates new form NewJFrame */
    public MenuPadrao(Conector con) {
        initComponents();
        this.conector = con;
        menuPrincipal = new MenuPrincipal(this, conector);
        BorderLayout layout = new BorderLayout();
        this.setLayout(layout);
        this.add( menuPrincipal, BorderLayout.CENTER );
        atual = menuPrincipal;
        menuServicoPesca = new MenuServicoPesca(this, conector);
        menuEditarCadastroCliente = new MenuCadastrarCliente(this, conector);
        menuCadastrarCliente = new MenuCadastrarCliente(this, "c", conector);
        menuCadastrarServicoPesca = new MenuCadastrarEditarServicoPesca(this, conector,"C");
        menuEditarServicoPesca = new MenuCadastrarEditarServicoPesca(this, conector, "E");
        menuEditarServicoPiscina = new MenuCadastrarEditarServicoPiscina(this, conector, "E");
        menuCadastrarServicoPiscina = new MenuCadastrarEditarServicoPiscina(this, conector, "C");
        menuCadastrarFuncionario = new MenuCadastrarFuncionario(this, "c", conector);
        menuEditarCadastroFuncionario = new MenuCadastrarFuncionario(this, "e", conector);
        menuExcluirCadastroFuncionario = new MenuCadastrarFuncionario(this, "d", conector);
        menuComprarPeixePiscina = new MenuComprarPeixePiscina(this, conector);
        menuPesqueiro = new MenuDadosPesqueiro1(this, conector);
        menuCadastrarCompraPeixes = new MenuCadastrarCompraPeixes(this, conector);
        relatorios = new Relatorios(this, conector);
        this.setVisible(true);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        jMenuItem12 = new javax.swing.JMenuItem();
        jMenuItem13 = new javax.swing.JMenuItem();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        jMenuItem11 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem8 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Pesque e Leve");
        setBounds(new java.awt.Rectangle(500, 500, 500, 500));

        jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/arquivoMini.png"))); // NOI18N
        jMenu1.setText("Arquivo");

        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/pesqueiro_editar.png"))); // NOI18N
        jMenuItem2.setText("Editar dados do Pesqueiro");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/compra_peixe.png"))); // NOI18N
        jMenuItem1.setText("Cadastrar compra de Peixes");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/peixe_cancelar3.png"))); // NOI18N
        jMenuItem3.setText("Sair");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem3);

        menuBar.add(jMenu1);

        jMenu6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/funcionarioMini.png"))); // NOI18N
        jMenu6.setText("Funcionário");

        jMenuItem12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/funcionario_cadastrar.png"))); // NOI18N
        jMenuItem12.setText("Cadastrar funcionário");
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem12);

        jMenuItem13.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/funcionario_editar_pesquisar.png"))); // NOI18N
        jMenuItem13.setText("Editar/Pesquisar funcionário");
        jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem13ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem13);

        jMenuItem14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/funcioanrio_excluir.png"))); // NOI18N
        jMenuItem14.setText("Excluir funcionário");
        jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem14ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem14);

        menuBar.add(jMenu6);

        jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/pescadorMini.png"))); // NOI18N
        jMenu2.setText("Cliente");

        jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/pescador_cadastro.png"))); // NOI18N
        jMenuItem4.setText("Cadastrar cliente");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedCadastrarCliente(evt);
            }
        });
        jMenu2.add(jMenuItem4);

        jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/pescador_editar_pesquisar.png"))); // NOI18N
        jMenuItem9.setText("Editar/Pesquisar Cliente");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedPesquisarCadastroCliente(evt);
            }
        });
        jMenu2.add(jMenuItem9);

        menuBar.add(jMenu2);

        jMenu3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/servicoMini.png"))); // NOI18N
        jMenu3.setText("Serviços");

        jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/servico_pesca_add.png"))); // NOI18N
        jMenuItem6.setText("Cadastrar Serviço de Pesca");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedCadastrarServicoPesca(evt);
            }
        });
        jMenu3.add(jMenuItem6);

        jMenuItem7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/servico_pesca_editar_remover.png"))); // NOI18N
        jMenuItem7.setText("Editar Serviço de Pesca");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedEditarServicoPesca(evt);
            }
        });
        jMenu3.add(jMenuItem7);

        jMenuItem5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/servico_piscina_add.png"))); // NOI18N
        jMenuItem5.setText("Cadastrar Serviço de Piscina");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedCadastrarServicoPiscina(evt);
            }
        });
        jMenu3.add(jMenuItem5);

        jMenuItem10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/servico_piscina_editar_Remover.png"))); // NOI18N
        jMenuItem10.setText("Editar Serviço de Piscina");
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedEditarServicoPiscina(evt);
            }
        });
        jMenu3.add(jMenuItem10);

        menuBar.add(jMenu3);

        jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/relatoriosMini.png"))); // NOI18N
        jMenu5.setText("Relatórios");

        jMenuItem11.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/relatorio_visualizar.png"))); // NOI18N
        jMenuItem11.setText("Visualizar");
        jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem11actionPerformedCadastrarServicoPesca(evt);
            }
        });
        jMenu5.add(jMenuItem11);

        menuBar.add(jMenu5);

        jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/ajuda.png"))); // NOI18N
        jMenu4.setText("Ajuda");

        jMenuItem8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/informacao.png"))); // NOI18N
        jMenuItem8.setText("Sobre");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformedSobreHandler(evt);
            }
        });
        jMenu4.add(jMenuItem8);

        menuBar.add(jMenu4);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addContainerGap(974, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(297, 297, 297)
                .addComponent(jLabel1)
                .addGap(198, 198, 198))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-1000)/2, (screenSize.height-550)/2, 1000, 550);
    }// </editor-fold>//GEN-END:initComponents

private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
// TODO add your he here:
    this.dispose();
}//GEN-LAST:event_jMenuItem3ActionPerformed

private void actionPerformedPesquisarCadastroCliente(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedPesquisarCadastroCliente
    this.trocaPanel2(menuCadastrarCliente);
}//GEN-LAST:event_actionPerformedPesquisarCadastroCliente

private void actionPerformedCadastrarServicoPesca(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedCadastrarServicoPesca
    // TODO add your handling code here:
    menuCadastrarServicoPesca.refreshList();
    this.trocaPanel2(menuCadastrarServicoPesca);
}//GEN-LAST:event_actionPerformedCadastrarServicoPesca

private void actionPerformedEditarServicoPesca(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedEditarServicoPesca
    // TODO add your handling code here:
    menuEditarServicoPesca.refreshList();
    this.trocaPanel2(menuEditarServicoPesca);
}//GEN-LAST:event_actionPerformedEditarServicoPesca

private void actionPerformedEditarServicoPiscina(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedEditarServicoPiscina
    // TODO add your handling code here:
    this.trocaPanel2(menuEditarServicoPiscina);
}//GEN-LAST:event_actionPerformedEditarServicoPiscina

private void actionPerformedSobreHandler(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedSobreHandler
    // TODO add your handling code here:
    this.trocaPanel2(sobreGrupo);
}//GEN-LAST:event_actionPerformedSobreHandler

private void actionPerformedCadastrarServicoPiscina(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedCadastrarServicoPiscina
    // TODO add your handling code here:
     this.trocaPanel2(menuCadastrarServicoPiscina);
}//GEN-LAST:event_actionPerformedCadastrarServicoPiscina

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
    // TODO add your handling code here:
        this.trocaPanel2(menuPesqueiro);
}//GEN-LAST:event_jMenuItem2ActionPerformed

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed

    this.trocaPanel2(menuCadastrarCompraPeixes);
    // TODO add your handling code here:
}//GEN-LAST:event_jMenuItem1ActionPerformed

private void jMenuItem11actionPerformedCadastrarServicoPesca(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11actionPerformedCadastrarServicoPesca
    this.trocaPanel2(relatorios);
}//GEN-LAST:event_jMenuItem11actionPerformedCadastrarServicoPesca

private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
    // TODO add your handling code here:
    this.trocaPanel2(menuExcluirCadastroFuncionario);

}//GEN-LAST:event_jMenuItem14ActionPerformed

private void actionPerformedCadastrarCliente(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionPerformedCadastrarCliente
    // TODO add your handling code here:
    this.trocaPanel2(menuEditarCadastroCliente);
}//GEN-LAST:event_actionPerformedCadastrarCliente

private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
    // TODO add your handling code here:
    this.trocaPanel2(menuEditarCadastroFuncionario);
}//GEN-LAST:event_jMenuItem13ActionPerformed

private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
    // TODO add your handling code here:
    this.trocaPanel2(menuCadastrarFuncionario);
}//GEN-LAST:event_jMenuItem12ActionPerformed
    public void trocaPanel2(JPanel novo) {

        atual.setVisible(false);
        this.add(novo,BorderLayout.CENTER);
        novo.setVisible(true);
        atual = novo;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JMenuBar menuBar;
    // End of variables declaration//GEN-END:variables

    public MenuCadastrarCliente getMenuCadastrarCliente() {
        return menuCadastrarCliente;
    }

    public void setMenuCadastrarCliente(MenuCadastrarCliente menuCadastrarCliente) {
        this.menuCadastrarCliente = menuCadastrarCliente;
    }

    public MenuCadastrarEditarServicoPesca getMenuEditarServicoPesca() {
        return menuEditarServicoPesca;
    }

    public void setMenuEditarServicoPesca(MenuCadastrarEditarServicoPesca menuCadastrarEditarServicoPesca) {
        this.menuEditarServicoPesca = menuCadastrarEditarServicoPesca;
    }

    public MenuCadastrarEditarServicoPesca getMenuCadastrarServicoPesca() {
        return menuCadastrarServicoPesca;
    }

    public void setMenuCadastrarServicoPesca(MenuCadastrarEditarServicoPesca menuCadastrarServicoPesca) {
        this.menuCadastrarServicoPesca = menuCadastrarServicoPesca;
    }

    public MenuPrincipal getMenuPrincipal() {
        return menuPrincipal;
    }

    public void setMenuPrincipal(MenuPrincipal menuPrincipal) {
        this.menuPrincipal = menuPrincipal;
    }

    public MenuComprarPeixePiscina getMenuComprarPeixePiscina() {
        return menuComprarPeixePiscina;
    }

    public void setMenuComprarPeixePiscina(MenuComprarPeixePiscina menuComprarPeixePiscina) {
        this.menuComprarPeixePiscina = menuComprarPeixePiscina;
    }

    public MenuServicoPesca getMenuServicoPesca() {
        return menuServicoPesca;
    }

    public void setMenuServicoPesca(MenuServicoPesca menuServicoPesca) {
        this.menuServicoPesca = menuServicoPesca;
    }
}